<?php

namespace app\middleware;

use think\Request;

class CheckMethod
{
    public function handle()
    {
        $request = new Request();
        header("Access-Control-Allow-Origin: *");
        header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
        header('Access-Control-Allow-Headers: *');
        if ($request->method() == 'OPTIONS') {
            exit();
        }
    }
}
